#include "material/navigationhelpermaterial.h"


CNavigationHelperMaterial::CNavigationHelperMaterial():
CMaterial() {

}
CNavigationHelperMaterial::~CNavigationHelperMaterial() {

}
void CNavigationHelperMaterial::Init() {
    CMaterial::Init();

    const char* _strVertexShader = SHADERCODE(
uniform mat4 projectionViewMatrix;
attribute vec3 a_position;
attribute vec4 a_color0;
attribute vec2 a_texcoord0;
varying vec4 vColor;
varying vec2 vUv;
void main(){
    gl_Position = projectionViewMatrix * vec4( a_position, 1.0 );
    vColor = a_color0;
    vUv = a_texcoord0;
}
);


    const char* _strFragmentShader = SHADERCODE(
uniform sampler2D diffuseMap;
varying vec2 vUv;
varying vec4 vColor;
void main() {
    vec4 col = texture2D( diffuseMap, vUv );
    gl_FragColor = col;
}
);

    m_hMaterialHandle = Material_Create("NavigationHelperMaterial", (byte*)_strVertexShader, strlen(_strVertexShader), (byte*)_strFragmentShader, strlen(_strFragmentShader));
    m_hProjectionViewMatrixHandle = Material_GetUniform(m_hMaterialHandle, "projectionViewMatrix", EUT_MATRIX44);
    m_hDiffuseMapHandle = Material_GetUniform( m_hMaterialHandle, "diffuseMap", EUT_SAMPLER );
}

